package com.aaa.a1102.demo02;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author 荆豪峰
 * @version 1.0
 */
public class Test02 {
    public static void main(String[] args) {
        ExecutorService executorService1 = Executors.newFixedThreadPool(5);
          for (int i = 0; i < 10;i++) {
            executorService1.submit(new Runnable() {
                public void run() {
                    System.out.println(Thread.currentThread().getName() + "========");
                }
            });
     }
          executorService1.shutdownNow();

        boolean shutdown = executorService1.isShutdown();
        System.out.println(shutdown);

        boolean terminated = executorService1.isTerminated();
        System.out.println(terminated);
    }
}
